package cn.lk1234.imt.controller;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import cn.lk1234.imt.dao.dbtool.MapBean;
import cn.lk1234.imt.service.ModuleService;

@Controller
public class ModuleController {
	@Autowired
	public ModuleService moduleService;

	@RequestMapping(value = "/getModuleList")
	public ModelAndView getModuleList(HttpServletRequest request, HttpServletResponse response,
			HttpSession httpSession, Model model) throws IOException, SQLException {
		ModelAndView view = null;
		List<MapBean> moduleList = moduleService.getModuleList();
		model.addAttribute("moduleList", moduleList);
		view = new ModelAndView("module/moduleList");
		return view;
	}
}
